package com.yq.spbYq.service.impl;

import com.yq.spbYq.ViolationRecord;
import com.yq.spbYq.mapper.ViolationRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ViolationRecordService {

    @Autowired
    private ViolationRecordMapper violationRecordMapper;

    public List<ViolationRecord> getAllRecords() {
        return violationRecordMapper.selectAllRecords();
    }

    public ViolationRecord getRecordById(Integer vrId) {
        return violationRecordMapper.selectRecordById(vrId);
    }

    public int addRecord(ViolationRecord record) {
        return violationRecordMapper.insertRecord(record);
    }

    public int updateRecord(ViolationRecord record) {
        return violationRecordMapper.updateRecord(record);
    }

    public int deleteRecordById(Integer vrId) {
        return violationRecordMapper.deleteRecordById(vrId);
    }
}